package net.citrite.android;

import com.android.utils.ILogger;
import org.python.antlr.ast.Str;

import java.util.logging.Logger;


public class LogWrapper implements ILogger{
    private Logger logger;
    public LogWrapper(Logger logger) {
        this.logger = logger;
    }

    @Override
    public void error(Throwable throwable, String s, Object... objects) {
        if (throwable != null) {
            logger.severe(throwable.toString());
        }
        String msg = String.format(s, objects);
        logger.severe(msg);
    }

    @Override
    public void warning(String s, Object... objects) {
        String msg = String.format(s, objects);
        logger.warning(msg);
    }

    @Override
    public void info(String s, Object... objects) {
        String msg = String.format(s, objects);
        logger.info(msg);
    }

    @Override
    public void verbose(String s, Object... objects) {
        String msg = String.format(s, objects);
        logger.fine(msg);
    }
}
